<template>
    <uxt-page :title="title">
        <uxt-bar-group title="设置">
            <uxt-color-selector-bar
                title="颜色"
                desc="color=xx/颜色值"
                v-model="color"
            ></uxt-color-selector-bar>
            <uxt-color-selector-bar
                title="背景"
                desc="bg-color=xx/颜色值"
                v-model="bgColor"
                light
                gradual
            ></uxt-color-selector-bar>
            <uxt-bar title="提示" desc="tip">
                <template slot="right">
                    <uxt-input
                        classes="solid radius margin-xs"
                        :styles="{ width: '200rpx' }"
                        v-model="tip"
                    ></uxt-input>
                </template>
            </uxt-bar>
        </uxt-bar-group>
        <uxt-bar-group title="展示">
            <view class="padding bg-white text-center">
                <view class="padding bg-theme text-center round" @click="handleClick">
                    打开加载等待
                </view>
            </view>
        </uxt-bar-group>
    </uxt-page>
</template>

<script>
import uxtBarGroup from '@xtcoder/uxt/components/uxt-bar-group.vue'
import uxtColorSelectorBar from '@xtcoder/uxt/components/uxt-color-selector-bar.vue'
import uxtBar from '@xtcoder/uxt/components/uxt-bar.vue'
import uxtInput from '@xtcoder/uxt/components/uxt-input.vue'

export default {
    components: {
        uxtBarGroup,
        uxtColorSelectorBar,
        uxtBar,
        uxtInput
    },
    data() {
        return {
            title: '加载等待',
            color: 'theme',
            bgColor: 'white',
            tip: '加载中...',
            events: ''
        }
    },
    methods: {
        handleClick() {
            this.uxtLoading({
                color: this.color,
                bgColor: this.bgColor,
                tip: this.tip
            }).show()
            setTimeout(() => {
                this.uxtLoading().hide()
            }, 5000)
        }
    }
}
</script>

<style lang="scss" scoped></style>
